# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.BigQueryDataTransfer.V1.Model.ScheduleOptionsV2 do
  @moduledoc """
  V2 options customizing different types of data transfer schedule. This field supports existing time-based and manual transfer schedule. Also supports Event-Driven transfer schedule. ScheduleOptionsV2 cannot be used together with ScheduleOptions/Schedule.

  ## Attributes

  *   `eventDrivenSchedule` (*type:* `GoogleApi.BigQueryDataTransfer.V1.Model.EventDrivenSchedule.t`, *default:* `nil`) - Event driven transfer schedule options. If set, the transfer will be scheduled upon events arrial.
  *   `manualSchedule` (*type:* `GoogleApi.BigQueryDataTransfer.V1.Model.ManualSchedule.t`, *default:* `nil`) - Manual transfer schedule. If set, the transfer run will not be auto-scheduled by the system, unless the client invokes StartManualTransferRuns. This is equivalent to disable_auto_scheduling = true.
  *   `timeBasedSchedule` (*type:* `GoogleApi.BigQueryDataTransfer.V1.Model.TimeBasedSchedule.t`, *default:* `nil`) - Time based transfer schedule options. This is the default schedule option.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :eventDrivenSchedule =>
            GoogleApi.BigQueryDataTransfer.V1.Model.EventDrivenSchedule.t() | nil,
          :manualSchedule => GoogleApi.BigQueryDataTransfer.V1.Model.ManualSchedule.t() | nil,
          :timeBasedSchedule =>
            GoogleApi.BigQueryDataTransfer.V1.Model.TimeBasedSchedule.t() | nil
        }

  field(:eventDrivenSchedule, as: GoogleApi.BigQueryDataTransfer.V1.Model.EventDrivenSchedule)
  field(:manualSchedule, as: GoogleApi.BigQueryDataTransfer.V1.Model.ManualSchedule)
  field(:timeBasedSchedule, as: GoogleApi.BigQueryDataTransfer.V1.Model.TimeBasedSchedule)
end

defimpl Poison.Decoder, for: GoogleApi.BigQueryDataTransfer.V1.Model.ScheduleOptionsV2 do
  def decode(value, options) do
    GoogleApi.BigQueryDataTransfer.V1.Model.ScheduleOptionsV2.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.BigQueryDataTransfer.V1.Model.ScheduleOptionsV2 do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
